#include<stdio.h>
#include<sys/wait.h>
#include<sys/types.h>
#include<unistd.h>
int main(){
        pid_t child_pid;
        child_pid=fork();
        if(child_pid<0){
          perror("FOrk failed");
          return 1;
        }else if(child_pid==0){
          printf("Child process:My PID is%d\n",getpid());
        }else{
          printf("Parent process:Child process ID is%d\n",child_pid);
          int status;
	  waitpid(child_pid,&status,0);
	  if(WIFEXITED(status)){
		printf("Parent process:Child exited with status %d\n",WIFEXITED(status));
          }
	}
        return 0;
       }

